/**
 * 项目操作路由
 */
const express = require('express')
const router = express.Router()
const expressJoi = require('@escook/express-joi')
const {add_project_info_schema, del_project_info_schema, update_project_info_schema, get_project_info_All_schema, get_project_info_byTitle_schema, get_project_info_by_proId_schema } = require('../schema/projectInfo')

// 导入操作项目信息的模块
const projectinfoHandler = require('../router_handler/projectinfo')

// 增
router.post('/addProjectinfo', projectinfoHandler.addProjectinfo)
// 删
router.post('/delProjectinfo', expressJoi(del_project_info_schema), projectinfoHandler.delProjectinfo)
// 改
router.post('/updateProjectinfo', expressJoi(update_project_info_schema), projectinfoHandler.updateProjectinfo)
// 根据id改精选
router.post('/updateProjectSelectedByProjectId', projectinfoHandler.updateProjectSelectedByProjectId)
// 根据id改热门
router.post('/updateProjectHotByProjectId', projectinfoHandler.updateProjectHotByProjectId)
// 查
router.get('/getProjectinfoAll', projectinfoHandler.getProjectinfoAll)
// 根据项目id查询项目信息
router.post('/getProjectinfoById', projectinfoHandler.getProjectinfoByProId)
// 模糊查询项目名
router.post('/getProjectinfoByTitle', projectinfoHandler.getProjectinfoByTitle)


module.exports = router
